function tabDep(a){
	var m = document.getElementById('selectDep').getElementsByTagName('a');
	var count;
	if(m[a].className=='actDep') return;
	else{
		for(var i=0;i<m.length;i++){
			if(m[i].className=='actDep'){
				count = i;
				m[i].className='';
				break;
			}
		}
		m[a].className = 'actDep';
		a++;
		count++;
		document.getElementById('gameDep'+count).style.display = 'none';
		document.getElementById('gameDep'+a).style.display = 'block';
	}
}
function displayPopup(option){
	var div= document.createElement('div');
	div.setAttribute('id','bgPopUp');
	div.setAttribute('onclick','closePopUp('+option+')');
	document.body.appendChild(div);
	if(option==1){//create table
		document.getElementById('popUpCreateTbl').style.display = 'block';
	}else if(option==2){//find table
		document.getElementById('popUpFindTbl').style.display = 'block';
	}else if(option==3){//auto down card
		document.getElementById('popUpDownState').style.display = 'block';
	}
}

function closePopUp(option){
	var elem = document.getElementById('bgPopUp');
	document.body.removeChild(elem);
	if(option==1){//create table
		document.getElementById('popUpCreateTbl').style.display = 'none';
	}else if(option==2){//find table
		document.getElementById('popUpFindTbl').style.display = 'none';
	}else if(option==3){//auto down card
		document.getElementById('popUpDownState').style.display = 'none';
	}
}

